Skip to content

Add Model Router API documentation#1156

Merged
harshmaru7 merged 9 commits intodigitalocean:mainfrom
rsabhaya-do:rsabhaya/gen-ai-model-router
Apr 24, 2026
Merged

Add Model Router API documentation#1156
harshmaru7 merged 9 commits intodigitalocean:mainfrom
rsabhaya-do:rsabhaya/gen-ai-model-router

Conversation

@rsabhaya-do
Copy link
Copy Markdown
Contributor

@rsabhaya-do rsabhaya-do commented Apr 17, 2026

New public documentation for the model router api

https://do-internal.atlassian.net/browse/INF-244

"policies": [
{
"task_slug": "summarization",
"models": ["gemma3:latest", "gemma3:270m"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeing this error {"id":"invalid_argument","message":"rpc error: code = InvalidArgument desc = model gemma3:latest not found"}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to valid models: kimi-k2.5 openai-gpt5.4

api_key_info:
$ref: '#/apiModelProviderKeyInfo'
type: object
apiCreateModelRouterInputPublic:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entries are in alphabetical order, so apiGetModelRouter* must come before apiGetModelUsage*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

api_key_info:
$ref: '#/apiModelProviderKeyInfo'
type: object
apiDeleteModelRouterInputPublic:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't referenced anywhere, can you please check if its required ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it

usage:
$ref: '#/apiResourceUsage'
type: object
apiGetModelRouterInputPublic:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this too is unreferenced, kindly check if its required

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also removed

type: string
fallback_models:
items:
type: object
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be type: string to match the create schema (apiCreateModelRouterInputPublic) ?
Also missing description and example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, I have made that fix and changed type to string with a description/example

harshmaru7
harshmaru7 approved these changes Apr 24, 2026
Copy link
Copy Markdown
Contributor

@harshmaru7 harshmaru7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix fallback_models type in apiUpdateModelRouterInputPublic (line 5686) — should be type: string, not type: object. Also missing description and example to match apiCreateModelRouterInputPublic.

harshmaru7
harshmaru7 previously approved these changes Apr 24, 2026
Copy link
Copy Markdown
Contributor

@harshmaru7 harshmaru7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but can you confirm apiModelRouterSelectionPolicy.prefer as a free-form string instead of an enum ? since description mentions description: 'One of: none, cheapest, fastest'

prefer:
description: 'One of: none, cheapest, fastest'
example: '"cheapest"'
type: string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you need to add enum here.
enum: [none, cheapest, fastest]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it in :)

Copy link
Copy Markdown
Contributor

@harshmaru7 harshmaru7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants